Skip to content

Conversation

@InduSridhar
Copy link
Contributor


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings October 17, 2025 22:45
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Oct 17, 2025

⚠️Azure CLI Extensions Breaking Change Test
⚠️aks-preview
rule cmd_name rule_message suggest_message
⚠️ 1001 - CmdAdd aks nodepool get-rollback-versions cmd aks nodepool get-rollback-versions added
⚠️ 1001 - CmdAdd aks nodepool rollback cmd aks nodepool rollback added

@yonzhan
Copy link
Collaborator

yonzhan commented Oct 17, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds agentpool rollback functionality for AKS (Azure Kubernetes Service), enabling users to rollback nodepools to previously used configurations.

  • Adds two new commands: get-rollback-versions and rollback for AKS nodepools
  • Implements comprehensive test coverage for the new rollback functionality
  • Increments the extension version from 18.0.0b44 to 18.0.0b45

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
setup.py Version increment to 18.0.0b45
test_aks_commands.py Adds comprehensive test cases for get-rollback-versions and rollback commands
custom.py Implements core rollback functionality with version validation
commands.py Registers new commands with table formatting
_params.py Defines command-line parameters for rollback operations
_help.py Adds documentation and examples for new commands
_format.py Implements table formatting for rollback versions display
HISTORY.rst Documents the new features in version 18.0.0b45
Comments suppressed due to low confidence (8)

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py:1

  • Trailing whitespace should be removed for consistency with code formatting standards.
# --------------------------------------------------------------------------------------------

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py:12616

  • Trailing whitespace should be removed for consistency with code formatting standards.
        ).get_output_in_json()["id"]

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py:12616

  • Trailing whitespace should be removed for consistency with code formatting standards.
        ).get_output_in_json()["id"]

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py:1

  • Trailing whitespace should be removed for consistency with code formatting standards.
# --------------------------------------------------------------------------------------------

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py:12616

  • Trailing whitespace should be removed for consistency with code formatting standards.
        ).get_output_in_json()["id"]

@github-actions
Copy link

github-actions bot commented Oct 17, 2025

Hi @InduSridhar

Release Suggestions

Module: aks-preview

  • Update VERSION to 19.0.0b17 in src/aks-preview/setup.py

Notes

@github-actions github-actions bot added release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. and removed release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. labels Oct 17, 2025
@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Oct 22, 2025
@FumingZhang
Copy link
Member

don't forget to resolve the merge conflict

@InduSridhar
Copy link
Contributor Author

@github-actions github-actions bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Oct 23, 2025
Copy link
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix failed CI checks

Copy link
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self = <azure.cli.core._profile.Profile object at 0x7f0ed2d18450>
subscription = None

def get_subscription(self, subscription=None):  # take id or name
    subscriptions = self.load_cached_subscriptions()
    if not subscriptions:
      raise CLIError(_AZ_LOGIN_MESSAGE)

E knack.util.CLIError: Please run 'az login' to setup account.

../azure-cli/src/azure-cli-core/azure/cli/core/_profile.py:558: CLIError

  • generated xml file: /home/cloudtest/.azdev/env_config/mnt/vss/_work/1/s/env/test_results.xml -
    =========================== short test summary info ============================
    FAILED src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py::AzureKubernetesServiceScenarioTest::test_aks_nodepool_rollback
    ============ 1 failed, 837 passed, 78 skipped in 286.70s (0:04:46) =============

The newly added test case is failing because a corresponding recording file hasn't been included. As a result, CI attempts to run the test in live mode but encounters an az login error since the pipeline lacks the necessary credentials. To resolve this, please either commit the recording file or mark the test case with @live_only().

https://dev.azure.com/azclitools/public/public%20Team/_build/results?buildId=278230&view=logs&a…

@FumingZhang
Copy link
Member

please rebase from main to pick the fix in #9335 and then re-queue the live test.

@InduSridhar InduSridhar force-pushed the aks-agentpool-rollback branch 2 times, most recently from 2a70a8c to 6de5650 Compare November 10, 2025 15:48
@github-actions
Copy link

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@InduSridhar
Copy link
Contributor Author

@FumingZhang
Copy link
Member

CI failed with following error

except CannotOverwriteExistingCassetteException as ex:

      raise AssertionError(ex)

E AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_nodepool_rollback.yaml') in your current record mode ('once').
E No match for the request (<Request (PUT) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2025-09-02-preview>) was found.
E Found 1 similar requests with 1 different matcher(s) :
E
E 1 - (<Request (PUT) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2025-08-02-preview>)..)
E Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E Matchers failed :
E _custom_request_query_matcher - assertion failure :
E None

https://dev.azure.com/azclitools/public/public%20Team/_build/results?buildId=282022&view=logs&j=2e66ce57-bcb2-51b3-abdd-698c078f35ff&t=16b5c26c-808a-5e55-7cf9-03cc11587706&l=4569

Please create new recording file or manually update the API versions in the existing one.

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 10, 2025

Please fix CI issues

@FumingZhang
Copy link
Member

now the CI failed with error

ERROR: No module named 'azure.cli.core'
Traceback (most recent call last):
File "/mnt/vss/_work/1/s/env/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/mnt/vss/_work/1/s/env/lib/python3.9/site-packages/knack/invocation.py", line 224, in execute
cmd_result = parsed_args.func(params)
File "/mnt/vss/_work/1/s/env/lib/python3.9/site-packages/knack/commands.py", line 149, in call
return self.handler(*args, **kwargs)
File "/mnt/vss/_work/1/s/env/lib/python3.9/site-packages/knack/commands.py", line 256, in _command_handler
result = op(client, **command_args) if client else op(**command_args)
File "/mnt/vss/_work/1/s/env/lib/python3.9/site-packages/azdev/operations/testtool/init.py", line 46, in run_tests
path_table = get_path_table()
File "/mnt/vss/_work/1/s/env/lib/python3.9/site-packages/azdev/utilities/path.py", line 195, in get_path_table
from azure.cli.core.extension import EXTENSIONS_DIR # pylint: disable=import-error
ModuleNotFoundError: No module named 'azure.cli.core'

https://dev.azure.com/azclitools/public/public%20Team/_build/results?buildId=282107&view=logs&j=155127ab-52f1-52e7-0e45-625d9d7884a4&t=4bb67950-ef03-52d4-44f5-d1a8cd56c919&l=127

@wangzelin007 could you please help take a look?

@wangzelin007
Copy link
Member

now the CI failed with error

ERROR: No module named 'azure.cli.core'
Traceback (most recent call last):
File "/mnt/vss/_work/1/s/env/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/mnt/vss/_work/1/s/env/lib/python3.9/site-packages/knack/invocation.py", line 224, in execute
cmd_result = parsed_args.func(params)
File "/mnt/vss/_work/1/s/env/lib/python3.9/site-packages/knack/commands.py", line 149, in call
return self.handler(*args, **kwargs)
File "/mnt/vss/_work/1/s/env/lib/python3.9/site-packages/knack/commands.py", line 256, in _command_handler
result = op(client, **command_args) if client else op(**command_args)
File "/mnt/vss/_work/1/s/env/lib/python3.9/site-packages/azdev/operations/testtool/init.py", line 46, in run_tests
path_table = get_path_table()
File "/mnt/vss/_work/1/s/env/lib/python3.9/site-packages/azdev/utilities/path.py", line 195, in get_path_table
from azure.cli.core.extension import EXTENSIONS_DIR # pylint: disable=import-error
ModuleNotFoundError: No module named 'azure.cli.core'

https://dev.azure.com/azclitools/public/public%20Team/_build/results?buildId=282107&view=logs&j=155127ab-52f1-52e7-0e45-625d9d7884a4&t=4bb67950-ef03-52d4-44f5-d1a8cd56c919&l=127

@wangzelin007 could you please help take a look?

Fixed by #9412, please merge the latest code from the main into your branch.

indusridhar added 3 commits November 12, 2025 16:20
* Add az aks nodepool get-rollback-versions to get available rollback versions
* Add az aks nodepool rollback to rollback nodepool to N-1 configuration
* Add tests and recording file for nodepool rollback functionality
@InduSridhar InduSridhar force-pushed the aks-agentpool-rollback branch from 67fdc97 to 19a6f6d Compare November 13, 2025 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants